{extends file="skulton.tpl"}{/extends}
{block name="monblock"}


<script src="scripts/js/Form.js"></script>
<script>

$(function() {
    
    $( "#dialog-form" ).dialog({
      autoOpen: false,
      height: 400,
      width: 500,
      modal: true,
      buttons: {
      },
      close: function() {
        allFields.val( "" ).removeClass( "ui-state-error" );
      }
    });

    
  });

</script>

<script type="text/javascript" charset="utf-8">
  var asInitVals = new Array();
   
  $(document).ready(function() {
  
  
  

      $(".yesno").click(function(){
        var a = $(this);
        $( "#dialog-confirm" ).dialog({
            resizable: false,
            modal: true,
            buttons: {
              "Oui": function() {
                
                document.location.href="materielcommande.php?id_sup="+a.attr('id');
              },
              "Non": function() {
                $( this ).dialog( "close" );
              }
            }
        });
      });
  
  
  
    var oTable = $('#idtable').dataTable( {
      "sPaginationType": "full_numbers",
      "oLanguage": {
        "sSearch": "Rechercher:"
      }
    } );
     
     
    //recherche spécifique à la colone
    $("tfoot input").keyup( function () {
      /* Filter on the column (the index) of this element */
      oTable.fnFilter( this.value, $("tfoot input").index(this) );
    } );
     
     
     
    /*
     * Support functions to provide a little bit of 'user friendlyness' to the textboxes in
     * the footer
     */
    $("tfoot input").each( function (i) {
      asInitVals[i] = this.value;
    } );
     
    $("tfoot input").focus( function () {
      if ( this.className == "search_init" )
      {
        this.className = "";
        this.value = "";
      }
    } );
     
    $("tfoot input").blur( function (i) {
      if ( this.value == "" )
      {
        this.className = "search_init";
        this.value = asInitVals[$("tfoot input").index(this)];
      }
    } );
    
    
      
      // FORMULAIRE UI
      
      
      
      
    
  } );
</script>



    
<div class="content-box"><!-- Start Content Box -->
  
  <div class="content-box-header">
    
    <h3>Liste des matériels commandés</h3>
     <a href="genererPDF.php?&page=materielCommande"  style='margin-left:10px;'><img src="images/icons/PDF.png" ></a>
    <a href="genererXSL.php?&page=materielCommande"  style='margin-left:10px;'><img src="images/icons/excel.png" ></a>
    <!-- Formulaire -->
    
    <div class="clear"></div>
    
  </div> <!-- End .content-box-:>header -->
  <div class="content-box-content">
        
      </div> <!-- End #messages -->

    <div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->
    {if isset($message)}
      <div class="notification success png_bg">
        <a href="#" class="close"><img src="images/i/cross_grey_small.png" title="Close this notification" alt="close"></a>
        <div>
          {$message}
        </div>
      </div>
    {/if} 
      
  <div style="display:none;" id="dialog-confirm" title="Demande de confirmation">
    <p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>Voulez-vous vraiment supprimer cet enregistrement ?</p>
  </div>

  
      <table id="idtable">
        
        <thead>
          <tr>
             <th><input class="check-all" type="checkbox" /></th>
             <th>id</th>
             <th>Réference</th>
             <th>Constructeur</th>
             <th>Connecteur</th>
             <th>Type</th>
             <th>Etat</th>
             <th>Quantité</th>
             <th>Date de Commande</th>
             <th>Nomade</th>
             <th>Suppression</th>
          </tr>
          
        </thead>
      
       
        <tbody>
          {foreach $listmaterielcommande as $line}
          <tr>
            <td><input type="checkbox" /></td>
            <td>{$line->getId()}</td>
            <td>{$line->getReference()}</td>
            <td>{$line->getConstructeur()}</td>
            <td>{$line->getConnecteur()}</td>
            <td>{$line->getType()} </td>
            <td>{$line->getEtat()}</td>
            <td>{$line->getQuantite()}</td>
            <td>{$line->getDateCommande()}</td>
            <td>{$nomadeDao->loadNomade($line->getIdNomade())->getNom()} {$nomadeDao->loadNomade($line->getIdNomade())->getPrenom()}</td>
            <td>
               <a href="#" title="Delete" class="yesno with-tip supp" id="{$line->getId()}"><img src="images/icons/cross.png" alt="Delete" /></a>
              <!-- <a href="#" title="Edit Meta"><img src="images/icons/hammer_screwdriver.png" alt="Edit Meta" /></a> -->
            </td>
          </tr>
          
          {/foreach}
          
        </tbody>
        
        <tfoot>
          <tr>
            <th><input type="text" name="search_id" value="" class="search_int" style="display:none" /></th>
            <th><input type="text" name="search_id" value="" class="search_int" style="display:none" /></th>
            <th><input type="text" name="search_reference" value="" class="search_int" /></th>
            <th><input type="text" name="search_constructeur" value="" class="search_int" /></th>
            <th><input type="text" name="search_connecteur" value="" class="search_int"  /></th>
            <th><input type="text" name="search_type" value="" class="search_int" style="display:none" /></th>
            <th><input type="text" name="search_etat" value="" class="search_int"  /></th>
            <th><input type="text" name="search_quantite" value="" class="search_int"  /></th>
            <th><input type="text" name="search_dateCommande" value="" class="search_int"  /></th>
            <th><input type="text" name="search_idNomade" value="" class="search_int"  /></th>
            <th><input type="text" name="search_operations" value="" class="search_int" style="display:none"/></th>
            
            
          </tr>
        </tfoot>
        
      </table>
      
     
    </div> <!-- End #tab2 -->        
    
  </div> <!-- End .content-box-content -->

  {/block}
